<?php
require_once ('../lib/config.php');
require_once ('../lib/facebook.php');
require_once ('../lib/friends.php');
require_once ('../lib/friend.php');
require_once ('../lib/test.php');

$facebook = new Facebook(array(
    'appId' => FB_APP_ID,
    'secret' => FB_APP_SECRET,
    'cookie' => true
));

//Buttongs
$logout_button = "<a href='".$facebook->getLogoutUrl()."'><img src='http://static.ak.fbcdn.net/rsrc.php/z2Y31/hash/cxrz4k7j.gif'></a>"; 
$login_button = "<a href='".$facebook->getLoginUrl()."'><img src='http://static.ak.fbcdn.net/rsrc.php/zB6N8/hash/4li2k73z.gif'></a>";

$isValid = checkSessionValidity();

if(!$isValid){
    print $login_button;
    exit();
}else{
    print $logout_button;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////
// Test code start from here
///////////////////////////////////////////////////////////////////////////////////////////////////////
getPostsWithAllCommentsFQL();

print("<br/>Test code end");

